package com.bwie.controller;

import com.bwie.common.pojo.User;
import com.bwie.common.result.Result;
import com.bwie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author liuxin
 * @since 2025-04-20
 */
@RestController
@RequestMapping("/t-user")
public class UserController {

    @Autowired
    private UserService userService;

    // 根据手机号查询用户信息
    @GetMapping("/getUserByPhone/{phone}")
    public Result<User> getUserByPhone(@PathVariable("phone") String phone) {
        User user = userService.getUserByPhone(phone);
        return Result.success(user);
    }
}
